package com.spring.camel.project;

import com.spring.camel.project.entity.MyClass;
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.SimpleRegistry;

/**
  * @Date 2020/4/22 0:09
  * @Author wsh
  * @Desc
  */
public class BeanCamel {
    public static void main(String[] args) throws Exception {
        MyClass myClass = new MyClass();
        SimpleRegistry registry = new SimpleRegistry();
        registry.put("myClass",myClass);
        CamelContext context = new DefaultCamelContext(registry);
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {

            }
        });
        context.start();
        ProducerTemplate template = context.createProducerTemplate();
        template.sendBody("direct:start","我的信息");
    }
}
